import Login from '../views/Login'
import NotFound from '../views/NotFound'
import Main from '../components/Main/index'

import CfyList from '../views/Cfy/CfyList'
import CfyPub from '../views/Cfy/CfyPub'
import CfyEdit from '../views/Cfy/CfyEdit'
import JobList from '../views/Job/JobList'
import JobPub from '../views/Job/JobPub'
import Setting from '../views/Setting'
import DashBoard from '../views/DashBoard'

import {
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  UserOutlined,
  VideoCameraOutlined,
} from '@ant-design/icons';

//第一层路由映射数据包
const mainRoutes = [ 
  {
    path:'/login',
    component:Login
  },
  {
    path: '/404',
    component: NotFound
  }
]

//第二层路由映射数据包
const adminRoutes = [
  {
    path: '/admin',
    component: DashBoard,
    title: '平台首页',
    icon: <MenuFoldOutlined />,
    roles: ['root', 'worker', 'company'],
    exact:true
  },
  {
    title:'分类管理',
    roles:['root','worker'],
    children:[
      {
        path: '/admin/cfy/pub',
        component: CfyPub,
        title: '发布分类',
        icon: <MenuFoldOutlined />,
        roles: ['root'],
      },
      {
        path: '/admin/cfy/list',
        component: CfyList,
        title: '分类列表',
        icon: <MenuUnfoldOutlined />,
        roles: ['root', 'worker'],
      },
      {
        path: '/admin/cfy/edit/:id',
        component: CfyEdit,
        icon: <MenuUnfoldOutlined />,
        roles: ['root', 'worker'],
      }
    ]
  },
  {
    title:'岗位管理',
    roles: ['root', 'worker','company'],
    children:[
      {
        path: '/admin/job/pub',
        component: JobPub,
        title: '发布岗位',
        icon: <UserOutlined />,
        roles: ['root', 'company']
      },
      {
        path: '/admin/job/list',
        component: JobList,
        title: '岗位列表',
        icon: <VideoCameraOutlined />,
        roles: ['root', 'worker']
      },
    ]
  },
  {
    path: '/admin/setting',
    component: Setting,
    title: '个人设置',
    icon: <UserOutlined />,
    roles: ['root', 'worker', 'company']
  },
  {
    path: '/admin/404',
    component: NotFound,
    roles: ['root', 'worker', 'company']
  }
]

export {
  mainRoutes,
  adminRoutes
}